home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
net
/
spakparnet_0_5.lha
/
par
/
steps
< prev
next >
Wrap
Text File
|
1992-11-10
|
4KB
|
125 lines
what do I want?
at the moment
steps for "reading into memory"
Add DMA address
send a packet out
wait for the DMA to complete (from incoming packets)
on the receive side there is a seperate header/body - this is unnec. since
memory must be allocd for the body anyway - we may as well allocate everything
in one hit
for sending:
can DMA send - this automatically breaks the memory up into however big
you want
OR normal send - sends everything out as one large packet
problems: aborting on a DMA "read"
solution - have the packet send out results as well
2 "results" are sufficient since we are mainly interested in amiga dos packets
MODIFY:
ON receiving a packet the entire packet is alloc'd at the begining with a modified
packet head which changes depending on what should happen with this "packet"
have a combined send, DMA back type affair: Have a standardized DMA return format
NO replymsg's for "servers" since it should be up to them how much they should DMA
back at a time.
methods of doing a "write"
use a "readable" DMA list
send stuff off as a packet and let the destination allocate it and read it in
one hit - problem - what if we want to write out 20-30K - this chews the network
for a second - this is not too much of a problem, but it just isn't manners.
Not a real important problem - we'll deal with this later.
- however this may be a problem since it is up to the sender rather than the
receiver to decide on memory use <- this is always the case tho - solution - just
have the sender break everythign up into chunks however big they want.
methods of doing a "read"
use a "recv DMA list"
send off the combined send DMA reply message
the parallel port driver will send off the actual message and hold the DMA address for
later.
we wait until all DMA has completed, being entirely up to the remote machine
as to how much it actually writes per packet, then return the message to the caller
The remote machine's packet driver must perform the following:
receive the original message
begin sending off messages which have no DMA back.
steps for a "read"
get packet type (short) & length (long) majic (long) chksumhead chksumbody
if type: server (& server exists)
AllocMem(length)
Reply(OK)
GetRemainder (body)
test chksum
Reply(OK or BAD)
this is the body
if type: dmaintomem (& ok)
Reply(OK)
ReadRemainder, write into mem
if (lengthtogo == 0) read 16 more bytes (the result, 4 longs) into something
contained in the DMA node
test chksum
Reply(OK or BAD)
return the send-dmaback message if lengthtogo == 0 and everythign is ok.
match to above "read" ("SEND")
send mini-header
type = new packet (server) or DMABack (write)
I haave already written this....
is it worth going to this effort to split up our packets?
I think it is since it makes everything more fluent
allows more chances for other machines to take the network and not time out
I have the outline
packet request - possibly split into several parts
- recv'r must put the mem alloc'd into the DMA list for recv'ing
- sender must send it off
- once the recv's mem is full then it sends a message off to the controlling task
- the controlling task then starts sending DMA packets back to the initiator
FOR A WRITE
sender sends off "large" packet (which will be split into smaller ones)
(result place is put into DMA memory)
- actually there must be a request packet and then the rest of the memory
sender waits for DMA mem to fill and then returns the result
recv'r simply gets the packet, when the memory has been filled it notifies
the approp task which does stuff, finally DMA-sending the result back
- only problem - the sender determines how much memory the recv'r should
allocate - not entirely secure - can be circumvented simply by carrying around
max alloc in the file handles
FOR A READ
sender sends "READ packet" to the task & makes the dest a big DMA'able chunk
wait for the DMA to complete
the recv'r gets the request and then DMA's back stuff at leisure.
- there must actually be the main body in the DMA list, as well as a result
which is elsewhere - when the result is sent the caller should be notified.
yes this is a good system
-> packet type:
request
DMA write